﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Epam.PhotoGallery.Interfaces.DataTransferObjects.Book>>"
	MasterPageFile="~/Views/Shared/ViewMasterPage.Master" %>

<asp:Content ID="TitleContent" ContentPlaceHolderID="htmlHeader" runat="server">
	<link rel="stylesheet" type="text/css" href="<%= Url.Content("~/Content/css/library.css") %>" />
	<title>OfficeLibrary</title>
</asp:Content>
<asp:Content ID="MainContent" ContentPlaceHolderID="MainContent" runat="server">
	<div id="main">
		<%
			foreach (var book in Model)
			{

		%>
		<div class="book">
			<h3 class="bookTitle">
                <%=Html.ActionLink(book.FullName,"GetBookDetails",new {isbnID=book.ID}) %>
			</h3>
			<div class="informationWrapper">
				<span class="titleOfInformation">Owner: </span><span class="information">
					<%= book.Owner %></span> <span class="titleOfInformation">CurrentReader: </span>
				<span class="information">
					<%= book.CurrentReader  %></span>
				<%if (book.StartDate.HasValue)
	  { %>
				<span class="titleOfInformation">Start Date: </span><span class="information">
					<%= book.StartDate.Value.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture)%></span>
				<%} %>
			</div>
		</div>
		<% 
			}
		%>
	</div>
	<div id="pager">
		<%= Html.GeneratePageLinks((int)ViewData["currentPage"],(int)ViewData["totalPages"], currentPage=> Url.Action("Index",new {page=currentPage})) %>
	</div>
</asp:Content>
